import re

# var2 = "1a2b3c4d5e6f"
#
# # 使用正则表达式提取数字
# numbers = re.findall(r'\d+', var2)
#
# # 将提取的数字转换为整数并累加
# total = sum(map(int, numbers))
#
# print("提取的数字:", numbers)
# print("累加的结果:", total)
#
# var3 = "1a2b3c4d5e6f"
#
# total = 0
#
# for i in var3:
#     # 判断字符是否是数字
#     if i.isdigit():
#         total += int(i)
#
# print(total)
# var3 = "1a2b3c4d5e6f"
# # 初始化累加变量
# total = 0
# # 迭代字符串中的每个字符
# for char in var3:
#     # 判断字符是否是数字
#     if char.isdigit():
#         # 如果是数字，将其转换为整数并累加到total
#         total += int(char)
#
# print("累加的结果:", total)

# var3 = "1a2b3c4d5e6f"
#
# print(var3[0:11:2])
